import request from '@/utils/request'

export default {

    //1. 添加课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: `/eduService/course/addCourseInfo`,
            method: 'post',
            data: courseInfo
        })
    },

    //2. 查询所有讲师
    getListTeacher() {
        return request({
            url: `/eduService/teacher/findAll`,
            method: 'get'
        })
    },
    //3. 根据课程id查询课程基本信息
    getCourseInfoId(id) {
        return request({
            url: `/eduService/course/getCourseInfo/${id}`,
            method: 'get'
        })
    },
    //4. 修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: `/eduService/course/updateCourseInfo`,
            method: 'post',
            data: courseInfo
        })
    },
    //5. 课程确认信息显示
    getPublishCourseInfo(id) {
        return request({
            url: `/eduService/course/getPublicCourseInfo/${id}`,
            method: 'get'
        })
    },
    //6. 课程最终发布
    publishCourse(id) {
        return request({
            url: `/eduService/course/publicCourse/${id}`,
            method: 'post'
        })
    },
    //7. 课程列表 TODO
    getListCourse() {
        return request({
            url: `/eduService/course`,
            method: 'get'
        })
    },
    //8. 根据课程id删除对应数据
    deleteCourse(id) {
        return request({
            url: `/eduService/course/${id}`,
            method: 'delete'
        })
    }
}
